package homework;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

public class Work6 {
	public static void main(String[] args) {
		ArrayList<Character> arrayList = new ArrayList<Character>();
		HashMap<Character, Integer> map=new HashMap<>();
		Collections.addAll(arrayList, 'a','a','b','b','c');
		for(int i=0;i<arrayList.size();i++){
			if(map.containsKey(arrayList.get(i))){
				map.put(arrayList.get(i), map.get(arrayList.get(i))+1);
			}else{
				map.put(arrayList.get(i), 1);
			}
		}
		for(Character c:map.keySet()){
			if(map.get(c)!=1){
				arrayList.remove(arrayList.indexOf(c));
			}
		}
		System.out.println(arrayList);
	}
}
